<?=form_open("lkm/log_keluar_masuk/resume");?>

<table class="table" style="width: auto">
<tr>
	<td class="th">Tanggal Log</td>
	<td><input type="text" name="tanggal_log" id="datetime_tanggal_log" value='<?=$tanggal_log?>' size="12" onchange="this.form.submit()"></td>
</tr>
</table>
<?=form_close(); ?>

<table class="table table-autosort:0 sort07 table-stripeclass:alternate" id="table-bursar" style="width:auto">
<thead>
<tr>
	<th>NIM</th>
	<th>Nama</th>
	<th>Jumlah</th>
	<th>Keluar</th>
	<th>Masuk</th>
</tr>
</thead>
<tbody>

<?php 
foreach ($data as $nim => $val) {
	echo "<tr>";
		echo "<td>$nim</td>";
		echo "<td>".$val["log"][0]["name"]."</td>";
		echo "<td>".count($val["resume"])."</td>";
		echo "<td>".$val["resume"][0]["OUT"]["dt_log"]."</td>";
		echo "<td>".$val["resume"][0]["IN"]["dt_log"]."</td>";
	echo "</tr>";
	if(count($val["resume"])>1) {
		for($i=1;$i<count($val["resume"]);$i++) {
			echo "<tr>";
				echo "<td></td>";
				echo "<td></td>";
				echo "<td></td>";
				echo "<td>".$val["resume"][$i]["OUT"]["dt_log"]."</td>";
				echo "<td>".$val["resume"][$i]["IN"]["dt_log"]."</td>";
			echo "</tr>";			
		}
	}
} 
?>

</tbody>
</table>
<script type="text/javascript">
	jQuery(function() {
		jQuery('#datetime_tanggal_log').datepicker({
			duration: '',
			showTime: false,
			time24h: true,
			dateFormat: "yy-mm-dd",
			constrainInput: false
		 });
	});
</script>